//
//  TCLYUser.m
//  YuErmuYing
//
//  Created by LYang on 16/9/19.
//  Copyright © 2016年 Tiancheng. All rights reserved.
//

#import "TCLYUser.h"

@implementation TCLYUser
@synthesize userId,userAccount,userPwd;
static TCLYUser * users = nil;
-(void)encodeWithCoder:(NSCoder *)aCoder{
    [aCoder encodeObject:userId forKey:@"usersId"];
    [aCoder encodeObject:userAccount forKey:@"usersAccount"];
    [aCoder encodeObject:userPwd forKey:@"usersPwd"];
}
-(id)initWithCoder:(NSCoder *)aDecoder{
    if (self = [super init]) {
        userId = [aDecoder decodeObjectForKey:@"usersId"];
        userAccount = [aDecoder decodeObjectForKey:@"usersAccount"];
        userPwd = [aDecoder decodeObjectForKey:@"usersPwd"];
    }
    return self;
}
+(id)allocWithZone:(struct _NSZone *)zone{
    @synchronized(users) {
        if (!users) {
            users = [[super allocWithZone:nil] init];
        }
    }
    return users;
}

+(id)alloc{
    @synchronized(users) {
        if (!users) {
            users = [[super alloc] init];
        }
    }
    return users;
}
@end
